package io;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

public class OISDemo {
    public static void main(String[] args) throws IOException, ClassNotFoundException {

        //创建一个低级的文件字节输入流

        FileInputStream fis = new FileInputStream("./person.txt");

        ObjectInputStream ois = new ObjectInputStream(fis);

        //使用ois将person.txt文件中存储的序列化对象反序列化

        Person p = (Person) ois.readObject();
        System.out.println(p);
        ois.close();

    }
}
